home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Environments
/
MacMETH 3.2.4
/
MEdit ƒ
/
Macros ƒ
/
MacroCmds QuickRef
next >
Wrap
Text File
|
1996-06-20
|
5KB
|
90 lines
MEdit / MComp macro commands:
****************************
name type arg(s) explanation
• Dialog commands:
ALERT P $ displays an alert given by $
EALERT P $,$ displays an "error" alert given by $,$
PROMPT (B) $,{$|#} opens a dialog, writes $ and allows to edit $|#
KEYCOD P - opens a dialog to determine and insert a keycode & modifier
• Control commands:
CALL P # executes macro number # of the actually loaded macro file
IF P B,cmd executes only if B true
WHILE P B,cmd executes cmd as long as B remains true
SET P {$|#},$|# assigns the second arg to the first of same type
NOT B B negates the following boolean expression B
• File commands:
QSAVAS (B) $ Save As… dialog with suggested name $, returns if saved
SAVEAS P [$] saves a file under name $ if specified, otherwise
opens Save As… dialog with the actual windowname proposed
SAVE P - saves the frontwindow to disk, if title=Untitled asks for filename
OPEN (B) [$] opens file $ if specified, otherwise use standard openfile dialog
returns true if opened (boolean version omits error alerts)
CLOSE P - closes the frontwindow
PRINT P - prints the frontwindow's content
NEW P - opens an empty window and make it the active window
• Window commands:
SCRH # - returns screen height
SCRW # - returns screen width
PLACEW P #,#,#,# places & resizes the active window
WINDOW (B) # selects window # (first is 0; after macro exec the active becomes
the frontwindow), returns if exists
• Editing commands:
SELABS (B) # selects the absolute position #, returns if < eof
ABSPOS # - returns the absolute position of start of selection
INSERT P $ inserts the $ at the current selection ni the frontwindow
SELECT P #,#["|"#,#] selects position #,#; if specified until ["|"#,#]
SECT (B) # selects section # of frontwindow, returns wheter it exists
PASTE P - pastes the content of the clipboard to the actual position
COPY P - copies the current selection to the clipboard
CUT P - cuts out the current selection and copies it to the clipboard
CLEAR P - clears out the current selection
PUSH P - pushes the ref. of the current selection onto a 8 level stack
POP P - takes and selects the selection ref. from the stack and decrements the stack
DROP P - cancelles the curr. stacklevel and decrements the stack
APPEND P - appends a new empty section to the frontwindow
FIND (B) $ find and select next ocurrence of $, returns whether found
EFIND (B) $ find and select next ocurrence of expression $, returns whether found
• String commands (strings start with index 1):
$S $ - returns the current selection of the frontwindow
CAP $ $ capitalize str
DECAP $ $ decapitalize str
STR $ # converts # to a string $
VAL # $ converts the first number in $ to #
CHR $ # returns the ascii character with ordinal number #
ORD # $ returns the ordinal number of the ascii character $
STRCMP # $,$,# compares first and second $ (# =0 ignore case) and returns
0 if equal, -1 if first $ is smaller, +1 if first is greater
SUBSTR $ $,#,# returns a substring of $, starting at # and with # character length
CONCAT $ $[,$] returns a string resulting of concatenation of all $ (maxlength = 255)
LEN # $ returns the length of string $
STRPOS # $,$,# returns the position of substr in str starting from #
PUTSTR (B) #,$ writes a str to resource with id #, returns if successfully stored
(allowed range: [0 ≤ # 999] internally stored on 'STR ' 3000-3999)
GETSTR $ # reads a str from resource with id #, returns '' if nonexistent id
DATE $ # returns the actual date in a string, # is the format (0=short, 1=long, 2=abbrev)
TIME $ # returns the actual time in a string, # is the format (0=no secs, 1=secs)
WNAME $ - returns the name of the front window
• HighLevel-Events commands:
POSTHL B $,$,#,#,# post's high-level-event. Receiver is a application (in memory) with
creator (first $). EventClass is second $. EventID is first # (High-Word)
and second # (Low-Word). Third # is msgVal. Further explainations see inside
Macintosh V. POSTHLE returns TRUE if posting was possible.
LEGEND:
P = procedure;
$ = string value (function result/argument) or expression (argument);
# = numeric value (function result/argument) or expression (argument);
B = boolean value (function result/argument) or expression (argument);
() = optional result; [] = optional argument;
| = alternative argument; {} = must be variable; - = no argument.